package com.itheima.Demo;

import com.itheima.Utils.MybatisUtils;
import com.itheima.dao.UserMapping;
import com.itheima.pojo.User;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.Test;

public class Demo01 {
    @Test//查询id为1的用户及其订单信息
    public void demo01(){
        SqlSessionFactory sqlSessionFactory = MybatisUtils.getSqlSessionFactory();
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        UserMapping mapper = sqlSession.getMapper(UserMapping.class);
        User user = mapper.Find(1);
        System.out.println(user);
        sqlSession.close();
    }
}
